# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-pymssql
_pkgname=pymssql
pkgver=2.3.7
pkgrel=1
pkgdesc='DB-API interface to Microsoft SQL Server for Python. (new Cython-based version).'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/pymssql/#files'
license=('LGPL')
depends=('python' 'freetds')
makedepends=('python-pip' 'python-build' 'python-wheel' 'cython')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('cbf6668936e69a28f639a72f52032855c6fc2960b7b6a0594c59f5dfba61523869b7860389726e40e453a0c7def1cce69adaa7468d912565247e284de64225ac')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

